<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/order.js"></script>
<script>
    function addorder()
    {
        $('#addstorageform').modal('show');
    }
    function delone(id,t)
    {
        if(confirm("确定移除?"))
        {
            $.post("/deliverorder/ajaxbutton", {"op": "delone","id":id,"st":t},
                    function(data){
                        if(data.txt==200)
                        {
                            //document.location.href = data.url;
                            location.reload();
                            return;
                        }
                        if(data.txt==201)
                        {
                            alert(data.text);
                            return ;
                        }

                        return;
                    },"json");
        }
    }
    function Dodistribution()
    {
        var str = selectallpro();
        if(str !=false)
        {
            $.post("/deliverorder/ajaxbutton", {"op": "dodistribution","str":str},
                    function(data){
                        if(data==200)
                        {
                            document.location.href = '/deliverorder/emsexpress/8';
                        }
                    },"json");
        }
    }
    function moreopenMailNoUrl(t,orderType)
    {
        var str = selectallpro();
        if(str !=false)
        {
            window.open('/order/ajaxbutton?op=sfexpressurl&orderType='+orderType+'&id='+str+'', 'newwindow', 'width='+(window.screen.availWidth-10)+',height='+(window.screen.availHeight-30)+' , top=0, left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no');
        }


        /*
         var vote_arr = document.getElementsByName("ppid[]");
         var idarr = new Array();
         var i=0;
         var str="";
         for(var j = 0; j < vote_arr.length; j++)
         {
         if(vote_arr[j].checked == true)
         {
         idarr[i] = vote_arr[j].value;
         str += vote_arr[j].value+",";
         i++;
         }

         }
         if(i<=0){
         alert("未选中数据");
         }else{
         if(t==1)
         openMailNoUrl(str);
         if(t==2)
         openinvoiceUrl(str);

         }*/
    }
</script>
<title>E邮宝交运列表</title>
<body class="withvernav">
<div class="bodywrapper"> {{include file='/public/leftmenu.tpl'}}
    <div class="centercontent">
        <div class="pageheader notab">
            <h1 class="pagetitle">E邮宝线下上海交运列表</h1>
            <span class="pagedesc"></span>
            <div class="menulist">
                <ul class="profile_summary">
                    <!--
                    <li> <a href="javascript:void(0)" onClick="addorder()" class=""><span>燕文交运</span></a></li>
                    -->
                    <li><a href="/deliverorder/ajaxbutton?op=emsexpressPro"  target="_blank"><span>批量交运E邮宝线下上海</span></a></li>
                </ul>
            </div>
        </div>
        <!--pageheader-->

        <div id="contentwrapper" class="contentwrapper">
            <div id="basicform" class="subcontent">
                <!--搜索栏-->
                <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
                <form class="stdform stdform2" method="get" action="/deliverorder/emsexpress/8">
                    <input type="hidden" name="orderType" id="orderType" value="{{$orderType}}" >
                    <div class="tableoptions"> 交运时间：
                        <input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
                        关键词: <input type="text" name="other" id="other" class="width100" value="{{$other}}" placeholder="订单号或运单号" />
                        &nbsp;
                        订单状态:
                        <select name="statusst" class="selection" style="width:100px;">
                            <option value=""  selected>请选择</option>
                            <option value="1" {{if $statusst==1}} selected{{/if}}>已支付</option>
                            <option value="2" {{if $statusst==2}} selected{{/if}}>配货中</option>
                            <option value="3" {{if $statusst==3}} selected{{/if}}>已完成</option>
                        </select>

                        &nbsp;
                        <button class="btn btn_orange btn_search radius50">Search</button>
                        &nbsp;  &nbsp;
                        <a href="?isexe=1">{{if $isexe==1}}<font color="red">交运成功</font>{{else}}交运成功{{/if}}</a>
                        &nbsp;  &nbsp;
                        <a href="?isexe=2">{{if $isexe==2}}<font color="red">交运失败</font>{{else}}交运失败{{/if}}</a>
                        &nbsp;  &nbsp;
                        <a href="?isexe=3">{{if $isexe==3}}<font color="red">未交运</font>{{else}}未交运{{/if}}</a>
                        &nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;
                        <a href="javascript:void(0)" onClick="moreopenMailNoUrl(1,8)" class="btn btn2 btn_help"><span>打印标签</span></a>
                        &nbsp;&nbsp;
                        <!--
                        <a href="javascript:void(0)" onClick="moreopenMailNoUrl(2)" class="btn btn2 btn_help"><span>打印发票</span></a>
                        &nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;-->
                        <a href="javascript:void(0)" onClick="Dodistribution()" class="btn btn2 btn_help"><span>标配货</span></a>
                        &nbsp;&nbsp; &nbsp;&nbsp;
                        <a href="javascript:void(0)" onClick="repeatexpress(8)" class="btn btn2 btn_help"><span>重新交运</span></a>
                    </div>
                </form>
                <!--搜索栏结束-->

                <table cellpadding="0" cellspacing="0" border="0" class="stdtable">

                    <thead>
                    <tr>
                        <th class="head0"><input name="allchk" id="allchk" type="checkbox" onClick="allSelect('ppid[]')"></th>
                        <th class="head1">订单号</th>
                        <th class="head1">状态</th>
                        <th class="head1">客户名称</th>
                        <th class="head1">来源平台</th>
                        <th class="head1">国家</th>
                        <th class="head1">操作人</th>
                        <th class="head1">状态</th>
                        <th class="head1" style="width: 200px;">运单号</th>
                        <th class="head1">交运时间</th>
                        <th class="head1">操作</th>
                    </tr>
                    </thead>
                    {{foreach from=$orderlist item=detail key=key}}
                    <tr>
                        <td><input name="ppid[]" type="checkbox" value="{{$detail.id}}"></td>

                        <td>
                            {{if $detail.isform eq 0}}
                            <a href="/orderlist/orderlist?kw={{$detail.orderID}}" target="_blank">{{$detail.orderID}}</a>
                            {{else}}
                            <a href="http://192.168.1.100:89/eshop/order.do?method=edit&orderid={{$detail.orderID}}" target="_blank">{{$detail.orderID}}</a>
                            {{/if}}
                        </td>
                        <td>{{$detail.statusst}}</td>
                        <td>{{$detail.customerid}}</td>
                        <td>{{$detail.customertype}}</td>
                        <td>{{$detail.customerqq}}</td>
                        <td>{{$detail.createUser}}</td>
                        <td>{{if $detail.isexe==1}}交运完成{{/if}}{{if $detail.isexe==2}}<span style="color:red;">交运失败</span> {{/if}}{{if $detail.isexe==0}}未交运{{/if}}</td>
                        <td>{{if $detail.isexe==1}}{{$detail.mailNo}}{{/if}}{{if $detail.isexe==2}}{{$detail.exememo}}{{/if}}{{if $detail.isexe==0}}{{$detail.exememo}}{{/if}}</td>
                        <td>{{$detail.mailinstime}}</td>

                        <td> {{if $detail.isexe==2}}<a href="javascript:void(0)" onClick="delone({{$detail.id}},'delemsexpress')">删除</a>{{/if}}  {{if $detail.isexe==0}}<a href="javascript:void(0)" onClick="delone({{$detail.id}},'delemsexpress')" >删除</a>{{/if}}

                            {{if $managers || in_array('101',$showpower)}}{{if $detail.isexe==1}}<!--<a href="javascript:void(0)" onClick="delone({{$detail.id}},'delemsexpress')" >删除</a> | -->{{/if}}{{/if}}
                            {{if $detail.isexe==1}}

                                {{if $detail.printUrl && $detail.id gte 53483}}
                                    <a href="{{$detail.printUrl}}" target="_blank">pdf</a>
                                {{else}}
                                    <a href="/{{$detail.printUrl}}" target="_blank">pdf</a>
                                {{/if}}

                            &nbsp;&nbsp;|&nbsp;&nbsp;
                              <!-- <a href="/{{$detail.printUrl}}" target="_blank">标签</a>-->
                                    <a href="/order/ajaxbutton?op=sfexpressurl&orderType=8&id={{$detail.id}}," target="_blank">标签</a>

                            {{/if}}</td>
                    </tr>
                    {{/foreach}}



                </table>

                <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
            </div></div>
        <!-- 模态框（Modal）添加商品属性 -->
        <form action="/datareport/ajaxbutton?op=savemabangorder"  method="post" name="attributeform" id="attributeform" >
            <div class="modal fade" id="addstorageform" tabindex="-1" role="dialog" aria-labelledby="returnaddattributeform" aria-hidden="true">
                <div class="modal-dialog" style="width:740px;">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal"
                                    aria-hidden="true">× </button>
                            <h4 class="modal-title" id="returnaddattributeform"> 添加云途订单 </h4>
                        </div>
                        <div class="modal-body">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="100">云途订单号： </td>
                                    <td align="left"><textarea name="orderlist" id="orderlistst" cols="10" rows="10"></textarea></td>
                                </tr>
                                <tr>
                                    <td>注意： </td>
                                    <td align="left">一行一个订单号</td>
                                </tr>
                            </table>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default"
                                        data-dismiss="modal"> 关闭 </button>
                                <button type="button" class="btn btn-primary"  onclick="AWSsubmit('attributeform','addstorageform')"> 提交 </button>
                            </div>
                        </div>
                        <!-- /.modal-content -->
                    </div>
                    <!-- /.modal-dialog -->
                </div>
            </div>
            <!-- /.modal -->
        </form>
</body>
<div id="goToTop" style="display:none"><a href="javascript:;">TOP</a></div>
</html>